package com.nashuju.web.controller.login;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

import org.durcframework.core.SpringContext;

import com.nashuju.web.entity.article.ArticleBase;
import com.nashuju.web.service.article.ArticleBaseService;

public class HelloWorldTag extends SimpleTagSupport {

    // 重写 doTag 方法，该方法在标签结束生成页面内容
    public void doTag() throws JspException, IOException {
        // 获取页面输出流，并输出字符串
        ArticleBaseService cArticleBaseService = SpringContext.getBean(ArticleBaseService.class);
        // 获取页面输出流，并输出字符串
        ArticleBase cab = cArticleBaseService.get(88);
        this.getJspContext().setAttribute("ctime", cab.getCreated());
        getJspContext().getOut().write(cab.getContent());
    }
}
